package com.xiaohan.usercenter.common;

import lombok.Data;
import lombok.Getter;

import java.io.Serializable;

//@Data   //枚举值无法拥有set方法，因此此处无法使用该注解
@Getter   //为所有属性生成get方法
public enum ErrorCode implements Serializable {

	PARAMS_ERROR(40000,"请求参数错误",""),
	NULL_ERROR(40001,"数据为空",""),
	NOT_LOGIN(40100,"未登录",""),
	NO_AUTH(40101,"无权限",""),
	SYSTEM_ERROR(50000,"系统异常",""),
	;

	//全参构造
	ErrorCode(int code, String msg, String description) {
		this.code = code;
		this.msg = msg;
		this.description = description;
	}

	/**
	 * 错误码
	 */
	private final int code;

	/**
	 * 错误信息
	 */
	private final String msg;

	/**
	 * 错误描述
	 */
	private final String description;

}
